<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<title>凯盛项目管理系统</title>
</head>
<body class="body">&nbsp; 
	<%@ include file="include/top.jsp" %>
	
	<div class="container" style="padding-top:60px">
		<div class="row">
			<jsp:include page="include/side.jsp">
				<jsp:param value="document" name="tag"/>
			</jsp:include>
						
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px">
					<li class="active"><a href="#"><i class="icon-folder-open"></i>资料</a></li>
					<li class="pull-right"><a href="document.jspx?m=share" style="color:black"><i class="icon-plus"></i>分享新资料</a></li>
				</ul>
				
				<div style="height:450px">
					<c:forEach items="${page.result }" var="document">
						<blockquote style="padding-top:20px">
							<a href="#"><h4>${document.title }</h4></a>
							<p style="font-size:14px;line-height:1.5;">${document.content }</p>
							<small>${document.user.username }发布于 ${document.showTimeString }</small>
							<a href="document.jspx?m=update&id=${document.id }" title="编辑"><i class="icon-pencil"></i></a>
							<a href="document.jspx?m=delete&id=${document.id }" title="删除"><i class="icon-trash"></i></a>
						</blockquote>
					</c:forEach>
				</div>
					
					<div class="pagination pull-right">
					  <ul>
					  	<c:choose>
					  		<c:when test="${page.pageNum == 1 }">
					  			<li><a href="">首页</a></li>
					  		</c:when>
					  		<c:otherwise>
					  			<li><a href="logic.jspx?m=document&p=1">首页</a></li>	
					  		</c:otherwise>
					  	</c:choose>
						
						<c:choose>
							<c:when test="${page.pageNum == 1 }">
								<li><a href="#">上一页</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="logic.jspx?m=document&p=${page.pageNum - 1 }">上一页</a></li>		
							</c:otherwise>
						</c:choose>
						
						<c:choose>
							<c:when test="${page.pageNum == page.totalPages }">
								<li><a href="#">下一页</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="logic.jspx?m=document&p=${page.pageNum + 1 }">下一页</a></li>		
							</c:otherwise>
						</c:choose>
						
						<c:choose>
							<c:when test="${page.pageNum == page.totalPages }">
								<li><a href="#">尾页</a></li>
							</c:when>
							<c:otherwise>
								<li><a href="logic.jspx?m=document&p=${page.totalPages }">尾页</a></li>
							</c:otherwise>
						</c:choose>
						
					  </ul>
					</div>
				
				
			</div>
		</div>
	</div>
</body>
</html>